package com.health.dto;

import java.lang.reflect.InvocationTargetException;

import org.springframework.beans.BeanUtils;

import com.health.model.BasePO;

/**
 * @author DirkMurphy
 * 
 * @blog http://www.cnblogs.com/dirkmurphyjava/
 * 
 * @date
 * 
 * @introduction generic DTO class
 * 	
 */
public class BaseDTO
{
	/**
	 * convert a dto class to a model class
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 * */
	public BasePO convertDtoToPO(BaseDTO dto) throws IllegalAccessException, InvocationTargetException
	{
		BasePO po = new BasePO();
		if(dto == null) {
			return null;
		}
		BeanUtils.copyProperties(dto, po);
		return po;
	}
	
	
}
